#pragma once
#include <string>
#include <algorithm>
#include <functional>

inline char* SkipSpace( char*& msg )
{
	while( *msg && isspace(static_cast<unsigned char>(*msg) ) )
	{
		msg++;
	}
	return msg;
}
// trim from start 
static inline std::string &ltrim(std::string &s) { 
        s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(isspace)))); 
        return s; 
} 
 
// trim from end 
static inline std::string &rtrim(std::string &s) { 
        s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(isspace))).base(), s.end()); 
        return s; 
} 

// trim from both ends 
static inline std::string &trim(std::string &s) { 
        return ltrim(rtrim(s)); 
} 
 
